﻿#ifndef __SS_THREAD_LOCK_GUARD_H__
#define __SS_THREAD_LOCK_GUARD_H__
#include "ssThreadLock.h"

#ifdef SS_USE_BOOST_THREAD
#define SS_LOCK_GUARD(lk)	boost::lock_guard<boost::mutex> _guard(lk.m_mutex);
#else
namespace StarSeeker
{
	class ssThreadLockGuard
	{
	public:
		ssThreadLockGuard(ssThreadLock& lock);
		~ssThreadLockGuard();

	private:
		ssThreadLockGuard(const ssThreadLockGuard&);
		ssThreadLockGuard& operator = (const ssThreadLockGuard&);

		ssThreadLock&	m_lock;
	};
}
#define SS_LOCK_GUARD(lk)	StarSeeker::ssThreadLockGuard _guard(lk);
#endif

#endif
